<html lang="en">
<head>
  <meta charset="utf-8" />
  <title>post message</title>
</head>
<body>
<div id="test">Send me a message!</div>
<script>
    function listener(event) {
        var t = eval(event.data);

        document.getElementById("test").innerHTML = "received: " + t.test
    }

    if (window.addEventListener) {
        addEventListener("message", listener, false)
    } else {
        attachEvent("onmessage", listener)
    }
</script>

</body>
</html>